package com.mantou.proxyservice.proxeservice.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mantou.proxyservice.proxeservice.entity.Testurl;
import com.mantou.proxyservice.proxeservice.repository.TesturlRepository;
import com.mantou.proxyservice.proxeservice.service.TesturlService;

@Service
public class TesturlServiceImpl implements TesturlService {


	@Autowired
	private TesturlRepository testurlRepo;

	@Transactional
	public int create(Testurl testurl) {
		return testurlRepo.insert(testurl);
	}

	@Transactional
	public int createSelective(Testurl testurl) {
		return testurlRepo.insertSelective(testurl);
	}

	@Transactional
	public int deleteByPrimaryKey(Integer id) {
		return testurlRepo.deleteByPrimaryKey(id);
	}

	@Transactional(readOnly = true)
	public Testurl findByPrimaryKey(Integer id) {
		Testurl testurl = testurlRepo.selectByPrimaryKey(id);
		return testurl;
	}

	@Transactional(readOnly = true)
	public int selectCount(Testurl testurl) {
		return testurlRepo.selectCount(testurl);
	}

	@Transactional
	public int updateByPrimaryKey(Testurl testurl) {
		return testurlRepo.updateByPrimaryKey(testurl);
	}
	
	@Transactional
	public int updateByPrimaryKeySelective(Testurl testurl) {
		return testurlRepo.updateByPrimaryKeySelective(testurl);
	}

	@Override
	public List<Testurl> findall() {
		// TODO Auto-generated method stub
		Testurl queryTesturl = new Testurl();
		return testurlRepo.selectPage(queryTesturl, new PageRequest(0,Integer.MAX_VALUE));
	}

}
